package com.woniuxy.controller;


import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.common.Result;
import com.woniuxy.controller.form.CommentAttachmentForm;
import com.woniuxy.controller.form.StoreAttachmentForm;
import com.woniuxy.entity.CommentAttachment;
import com.woniuxy.entity.StoreAttachment;
import com.woniuxy.service.CommentAttachmentService;
import com.woniuxy.service.StoreAttachmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 评价附件表 前端控制器
 * </p>
 *
 * @author zz
 * @since 2023年06月13日
 */
@RestController
@RequestMapping("/commentAttachment")
@Api(tags = "评论附件相关接口")
public class CommentAttachmentController {


    @Autowired
    private CommentAttachmentService service;

    @PostMapping("/insert")
    @ApiOperation("新增商家信息附件表")
    public Result insert(CommentAttachmentForm form){
        CommentAttachment commentAttachment = BeanUtil.toBean(form, CommentAttachment.class);
        service.save(commentAttachment);
        return Result.success(200,"新增附件成功",null);
    }

}

